<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://www.ecside.org" prefix="ec"%>
<jsp:useBean id="pageBean" scope="request" class="com.agileai.hotweb.domain.PageBean"/>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>仿真任务列表</title>
<%@include file="/jsp/inc/resource.inc.jsp"%>
<script language="javascript">
var procGraphBox;
function showProcGraphBox(){
	if (!isSelectedRow()){
		writeErrorMsg('请先选中一条记录!');
		return;		
	}
	if (!procGraphBox){
		procGraphBox = new PopupBox('procGraphBox','流程定义图',{width:'900px',height:'500px',top:'10px',scroll:'yes'});		
	}	
	var url = "index?WfProcessInstanceView&actionType=prepareDisplay&WFIP_ID="+$('#processInstId').val() +"&WFP_ID="+$('#processId').val();
	procGraphBox.sendRequest(url);
}

function viewTaskDetail(){
	if (!isSelectedRow()){
		writeErrorMsg('请先选中一条记录!');
		return;		
	}
	var url = $("#bizFormURL").val() + "&WFP_ID="+$("#processId").val() + "&WFIP_ID="+$("#processInstId").val()
		+"&WFA_CODE="+$("#activityCode").val() + "&WFIP_BUSINESS_ID="+$("#bizRecordId").val();
	$("#bizFormURL").val(url) 
	
	doSubmit({actionType:'redirect'})
}
var selectUserBox;
function selectUserRequest(){
	if (!selectUserBox){
		selectUserBox = new PopupBox('selectUserBox','选择用户',{size:'big',height:'420px',width:'300px',top:'10px'});		
	}
	var url = 'index?SingleUserTreeSelect';
	selectUserBox.sendRequest(url);
}
function resetUserRequest(){
	$("#userId").val("");
	$("#userName").val("");
	doSubmit({actionType:'prepareDisplay'});	
}
</script>
</head>
<body>
<form action="<%=pageBean.getHandlerURL()%>" name="form1" id="form1" method="post">
<%@include file="/jsp/inc/message.inc.jsp"%>
<div id="__ParamBar__" style="float: right;">
当前用户
<input name="userName" type="text" class="text" id="userName" ondblclick="selectUserRequest()" value="<%=pageBean.inputValue("userName")%>" size="16" maxlength="16" readonly="readonly" />
<input name="userId" type="hidden" id="userId" value="<%=pageBean.inputValue("userId")%>" />
<img src="images/query.gif" width="16" height="16" onclick="selectUserRequest()" style="cursor:pointer" />
&nbsp;&nbsp;<input type="button" name="button" id="button" value="重置" class="formbutton" onclick="resetUserRequest()" />
</div>
<div id="__ToolBar__">
<table border="0" cellpadding="0" cellspacing="1">
<tr height="24px;">
	<td onmouseover="onMover(this);" onmouseout="onMout(this);" hotKey="V" class="bartdx" align="center" onClick="viewTaskDetail()"><input value="&nbsp;" type="button" class="detailImgBtn" title="查看" />查看</td>
	<td onmouseover="onMover(this);" onmouseout="onMout(this);" hotKey="V" class="bartdx" align="center" onClick="showProcGraphBox()"><input value="&nbsp;" type="button" class="flowStateImgBtn" title=流程图" />流程图</td>
	<td onmouseover="onMover(this);" onmouseout="onMout(this);" hotKey="B" class="bartdx" align="center" onClick="goToMain();"><input value="&nbsp;" type="button" class="backImgBtn" title="返回" />返回</td>        
</tr>
</table>
</div>
<ec:table 
form="form1"
var="row"
items="pageBean.rsList" csvFileName="仿真任务列表.csv"
retrieveRowsCallback="process" xlsFileName="仿真任务列表.xls"
useAjax="true" sortable="true"
doPreload="false" toolbarContent="navigation|pagejump |pagesize |export|extend|status"
width="100%" rowsDisplayed="10"
listWidth="100%" 
height="400px" 
>
<ec:row styleClass="odd" ondblclick="viewTaskDetail()" onclick="selectRow(this,{processId:'${row.WFP_ID}',processInstId:'${row.WFIP_ID}',bizRecordId:'${row.WFIP_BUSINESS_ID}',activityCode:'${row.WFA_CODE}'});">
	<ec:column width="50" style="text-align:center" property="_0" title="序号" value="${GLOBALROWCOUNT}" />
	<ec:column width="140" property="WFP_NAME" title="流程名称"   />
	<ec:column width="100" property="WFA_NAME" title="节点名称"   />
	<ec:column width="260" property="WFIP_TITLE" title="业务标题"   />
	<ec:column width="80" property="WFIP_STATUS" title="状态"   />
	<ec:column width="80" property="WFIP_OPERATER_NAME" title="提交人"   />
	<ec:column width="100" property="WFIP_OPERATER_TIME" title="提交时间"  cell="date" format="yyyy-MM-dd HH:mm" />
</ec:row>
</ec:table>
<input type="hidden" name="bizFormURL" id="bizFormURL" value="index?TaskApproveFrame" />
<input type="hidden" name="bizRecordId" id="bizRecordId" value="" />
<input type="hidden" name="processId" id="processId" value="" />
<input type="hidden" name="activityCode" id="activityCode" value="" />
<input type="hidden" name="processInstId" id="processInstId" value="" />
<input type="hidden" name="actionType" id="actionType" />
<script language="JavaScript">
setRsIdTag('bizRecordId');
</script>
</form>
</body>
</html>
<%@include file="/jsp/inc/scripts.inc.jsp"%>
